package com.aircms.dao;

import com.aircms.pojo.UserRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserRoleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserRole record);

    int insertSelective(UserRole record);

    UserRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserRole record);


    int updateByPrimaryKey(UserRole record);

    List<UserRole> selectUserRole(Integer userId);
    int deleteUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    int deleteByUserId(Integer userId);                   // 根据用户所有角色


    int checkByRoleIdAndUserId(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
}